home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / setjmp.man < prev    next >
Encoding:
Text File  |  1989-07-27  |  2.2 KB  |  67 lines

  1.  
  2.  
  3.  
  4. SETJMP                C Library Procedures                 SETJMP
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      setjmp, longjmp - non-local goto
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ##iinncclluuddee <<sseettjjmmpp..hh>>
  13.  
  14.      sseettjjmmpp((eennvv))
  15.      jjmmpp__bbuuff eennvv;;
  16.  
  17.      lloonnggjjmmpp((eennvv,, vvaall))
  18.      jjmmpp__bbuuff eennvv;;
  19.  
  20.      __sseettjjmmpp((eennvv))
  21.      jjmmpp__bbuuff eennvv;;
  22.  
  23.      __lloonnggjjmmpp((eennvv,, vvaall))
  24.      jjmmpp__bbuuff eennvv;;
  25.  
  26. DDEESSCCRRIIPPTTIIOONN
  27.      These routines are useful for dealing with errors and inter-
  28.      rupts encountered in a low-level subroutine of a program.
  29.  
  30.      _S_e_t_j_m_p saves its stack environment in _e_n_v for later use by
  31.      _l_o_n_g_j_m_p. It returns value 0.
  32.  
  33.      _L_o_n_g_j_m_p restores the environment saved by the last call of
  34.      _s_e_t_j_m_p.  It then returns in such a way that execution con-
  35.      tinues as if the call of _s_e_t_j_m_p had just returned the value
  36.      _v_a_l to the function that invoked _s_e_t_j_m_p, which must not
  37.      itself have returned in the interim.  All accessible data
  38.      have values as of the time _l_o_n_g_j_m_p was called.
  39.  
  40.      _S_e_t_j_m_p and _l_o_n_g_j_m_p save and restore the signal mask _s_i_g_-
  41.      _m_a_s_k(2), while __s_e_t_j_m_p and __l_o_n_g_j_m_p manipulate only the C
  42.      stack and registers.
  43.  
  44. EERRRROORRSS
  45.      If the contents of the jjmmpp__bbuuff are corrupted, or correspond
  46.      to an environment that has already returned, _l_o_n_g_j_m_p calls
  47.      the routine _l_o_n_g_j_m_p_e_r_r_o_r.  If _l_o_n_g_j_m_p_e_r_r_o_r returns the pro-
  48.      gram is aborted.  The default version of _l_o_n_g_j_m_p_e_r_r_o_r prints
  49.      the message ``longjmp botch'' to standard error and returns.
  50.      User programs wishing to exit more gracefully can write
  51.      their own versions of _l_o_n_g_j_m_p_e_r_r_o_r.
  52.  
  53. SSEEEE AALLSSOO
  54.      sigvec(2), sigstack(2), signal(3)
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0              January 9, 1986                        1
  64.  
  65.  
  66.  
  67.